//
//  MineRightHeadCVCell.m
//  Shine
//
//  Created by dllo on 16/3/11.
//  Copyright © 2016年 王斌. All rights reserved.
//

#import "MineRightHeadCVCell.h"
#define WIDTHCVCELL self.contentView.frame.size.width
#define HEIGHTCVCELL self.contentView.frame.size.height
@implementation MineRightHeadCVCell
- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)createCell{
    self.totalLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.totalLabel];
    self.stepNumberLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.stepNumberLabel];
    self.stepLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.stepLabel];
    self.kilocalorieLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.kilocalorieLabel];
    self.kilocalorieNumberLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.kilocalorieNumberLabel];
    self.kilometreLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.kilometreLabel];
    self.kilometreNumberLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.kilometreNumberLabel];
    self.hourLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.hourLabel];
    self.hourNumberLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.hourNumberLabel];
}

- (void)layoutSubviews{
    [super layoutSubviews];

    [self.totalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.top.mas_equalTo(10);
        make.width.mas_equalTo(WIDTHCVCELL/2);
        make.height.mas_equalTo(30);
    }];

    [self.stepNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(10);
        make.top.mas_equalTo(40);
        make.width.mas_equalTo(130);
        make.height.mas_equalTo(60);
    }];
    self.stepNumberLabel.textAlignment = YES;

    [self.stepLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(130);
        make.top.mas_equalTo(65);
        make.width.mas_equalTo(50);
        make.height.mas_equalTo(30);
    }];
    self.stepLabel.textAlignment = YES;

    [self.kilocalorieLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(10);
        make.top.mas_equalTo(100);
        make.width.mas_equalTo(60);
        make.height.mas_equalTo(30);
    }];
    self.kilocalorieLabel.textAlignment = YES;

    [self.kilocalorieNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.mas_equalTo(130);
        make.width.mas_equalTo(100);
        make.height.mas_equalTo(50);
    }];
    self.kilocalorieNumberLabel.textAlignment = YES;

    [self.kilometreLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(150);
        make.top.mas_equalTo(100);
        make.width.mas_equalTo(60);
        make.height.mas_equalTo(30);
    }];
    self.kilometreLabel.textAlignment = YES;

    [self.kilometreNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(130);
        make.top.mas_equalTo(130);
        make.width.mas_equalTo(100);
        make.height.mas_equalTo(50);
    }];
    self.kilometreNumberLabel.textAlignment = YES;

    [self.hourLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(WIDTHCVCELL-80);
        make.top.mas_equalTo(100);
        make.width.mas_equalTo(60);
        make.height.mas_equalTo(30);
    }];
    self.hourLabel.textAlignment = YES;

    [self.hourNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(WIDTHCVCELL-100);
        make.top.mas_equalTo(130);
        make.width.mas_equalTo(100);
        make.height.mas_equalTo(50);
    }];
    self.hourNumberLabel.textAlignment = YES;
    
}

@end
